/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.upload.service.processor;

import cn.hutool.core.bean.BeanUtil;
import info.peigen.hotpot.common.service.base.processor.Processor;
import info.peigen.hotpot.common.service.base.processor.ProcessorServiceContext;
import info.peigen.hotpot.component.upload.domain.Upload;
import lombok.extern.slf4j.Slf4j;
import org.noear.solon.annotation.Component;

/**
 * <b>(ActiveUploadProcessor)</b>
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2022/11/14
 */
@SuppressWarnings("rawtypes")
@Slf4j
@Component
public class ActiveUploadProcessor extends AbstractUploadServiceProcessor implements Processor {
    @Override
    public Integer level() {
        return 11;
    }

    @Override
    public void execute(ProcessorServiceContext serviceContext) {
        Upload upload = BeanUtil.toBean(serviceContext.getOrder(), Upload.class);
        serviceContext.setDomain(upload);
    }
}